Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
Is there a way to "pass" the user.name of auth0 user to a async function?

I'm creating a next.js app which reads a custom post type from a wordpress multisite. I want when a user sign-in (using auth0), the name of the user to go in the wordpress URL to replace the "site" name.

For example: I have this code in utils/wordpress.js

const BASE_URL = "https://fsm.xristosavgeros.com/sitename/wp-json/wp/v2/work";

export async function getPosts() {
  const postsRes = await fetch(BASE_URL + "?_embed");
  const posts = await postsRes.json();
  const filterPosts = posts.filter((post) => post.assigned_to == 'Johnny Worker');
  return filterPosts;
  }

What I need is something like this:

const BASE_URL = "https://fsm.xristosavgeros.com/ + user.name + /wp-json/wp/v2/work";

I think the way to go is useUser() hook but no matter where i tried to use it, the app crashes.

Any ideas?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!